package com.yunji.framework_template.common.constant;

import java.math.BigDecimal;

public class Constant {

    public static final String     CACHE_PREFIX                  = "cache_framework_template_";

    public static final String     ITEM_COUNTRY_TABLE            = "item_country_";

    public static final int        DEF_PAGE_SIZE                 = 10;

    public static final String     DATE_PATTERN_DAY              = "yyyy-MM-dd";

    public static final String     EMPTY_STRING                  = "";
    public static final String     COMMA                         = ",";
    public static final String     DOT                           = ".";
    public static final String     COLON                         = ":";
    public static final String     RIGHT_SQUARE_BRACKETS         = "]";
    public static final String     LEFT_SQUARE_BRACKETS          = "[";
    public static final String     ZERO_STR                      = "0";
    public static final String     CHARSET                       = "UTF-8";
    public static final String     HTTP_PROTOCOL                 = "http://";
    public static final String     HTTPS_PROTOCOL                = "https://";
    public static final String     LINE_SPLITER                  = "\n";
    public static final String     BLANK_STRING                  = " ";
    public static final String     QUOTATION_MARK                = "\"";
    public static final String     SLASH                         = "/";
    public static final int        MIOUS_ONE                     = -1;
    public static final int        ZERO                          = 0;
    public static final int        ONE                           = 1;
    public static final int        TWO                           = 2;
    public static final int        THREE                         = 3;
    public static final int        FOUR                          = 4;
    public static final String     EQUAL_MARK                    = "=";
    public static final String     AND                           = "&";
    public static final int        HTTP_STATUS_200               = 200;
    public static final String     UNDERLINE                     = "_";
    public static final String     UNDER_LINE                    = "_";
    public static final String     HYPHEN                        = "-";
    public static final String     IMG_SPLIT                     = "_IMG_";
    public static final BigDecimal BG_100                        = new BigDecimal(100);

    // 对象存放于redis中的存活周期，默认为5分钟
    public static final int        OBJECT_CACHE_IN_REDIS_MINUTES = 5 * 60;
    // 用户的数字签名，保存于redis中24小时
    public static final int        ONE_DAY_SECONDS               = 24 * 60 * 60;
    // 验证码放在redis中的有效时间
    public static final int        VERIFY_CODE_IN_REDIS_MINUTES  = 5 * 60;

    public static String           TIME_FORMAT                   = "yyyy-MM-dd HH:mm:ss";
    public static String           TIME_SEARCH_FORMAT            = "yyyy-MM-dd";

    public static final String     DEFAULT_CHARSET               = "UTF-8";

    public static final String     SORT_OTHER                    = "Other";

    public static final int        PAYMENT_TYPE_CHARGE           = 1;

    public static final int        PAYMENT_TYPE_FREE             = 0;

    public static final int        HTTP_CODE_200                 = 200;
    public static final int        HTTP_CODE_201                 = 201;
    public static final int        HTTP_CODE_400                 = 400;
    public static final int        HTTP_CODE_404                 = 404;
    public static final int        HTTP_CODE_500                 = 500;

    public static class HttpHeader {

        public static final String CONTENT_ENCODING = "Content-Encoding";
    }

    public static final int    ERROR              = -1;
    public static final int    SUCCESS            = 1;
    public static final int    FIVE               = 5;
    public static final int    ONE_THOUSAND       = 1000;
    public static final int    FIVE_THOUSAND      = FIVE * ONE_THOUSAND;
    public static final int    THIRTY_THOUSAND    = 30000;
    public static final int    ONE_HUNDRED        = 100;
    public static final String THREE_STARS        = "***";
    public static final String SUCCESS_DESC       = "success";
    public static final Object USER_SESSION_UID   = "akey";
    public static final Object ADMIN_SESSION_UID  = "mkey";
    public static final Object LOGIN_TAG_KEY      = "login_tag";
    public static final String NOT_LOGIN_FROM_URL = "login_from";
    public static final String INIT_ORDER_NUMBER  = "100000000000";
    public static final int    DefaultPageSize    = 10;
    public static final int    MaxPageSize        = 100;

    public static class Time {

        public static final int    FIVE_MINUTES   = 60 * 5;
        public static final int    THIRTY_MINUTES = 60 * 30;
        public static final int    ONE_HOUR       = 60 * 60;
        public static final int    ONE_DAY        = 60 * 60 * 24;
        public static final int    ONE_MONTH      = 60 * 60 * 24 * 30;
        public static final int    ONE_YEAR       = 60 * 60 * 24 * 365;
        public static final String START_HHMMSS   = "00:00:00";
        public static final String END_HHMMSS     = "23:59:59";
    }

    public static class RedisKey {

        public static final String APP = "redisKey::";
    }

    public static class ExpiredType {

        public static final int NOT_EXPIRED = 1;
        public static final int EXPIRED     = 0;
    }

    // 当前页面title高亮显示
    public static final String CURRENT_PAGE = "cur";
    public static final String CURRENT_MENU = "current";

    // 资源类型定义
    public static class ResourceStrType {

        public static final String BANNER_IMAGE            = "0";
        public static final String ACTIVITIES_AND_QA       = "1";
        public static final String DEVELOPER_DOCUMENTATION = "2";
        public static final String DEVELOPER_EVENTS        = "3";
        public static final String PLATFORM_DEVELOPMENT    = "4";
    }

    public static class ResourceIntType {

        public static final int BANNER_IMAGE            = 0;
        public static final int ACTIVITIES_AND_QA       = 1;
        public static final int DEVELOPER_DOCUMENTATION = 2;
        public static final int DEVELOPER_EVENTS        = 3;
        public static final int PLATFORM_DEVELOPMENT    = 4;
    }

    // 默认banner 图片的链接为#
    public static final String BANNER_LINK = "#";

    public static final String SOFT        = "s";
    public static final String VIDEO       = "v";
    public static final String DIGTIAL     = "d";
    public static final String BLACKBERRY  = "b";

    public static class AppCode {

        public static final int SUC          = 200;
        public static final int FAIL_SYSTEM  = 500;
        public static final int FAIL_VERSION = 300;

    }

    public static class Code {

        public static final int SUC                = 200;
        public static final int FAIL               = 500;
        public static final int NETWORK_ANOMALY    = 502;
        public static final int AFID_NOT_EXISTS    = 404;
        public static final int ACCOUNT_EXISTS     = 402;
        public static final int PARAM_ERROR        = 401;
        public static final int COUNTRY_NOT_EXISTS = 403;
        public static final int CAPTCHA_ERROR      = 300;

    }

    public static final String RESULT_CODE_KEY       = "code";
    public static final String RESULT_MSG_KEY        = "message";
    public static final String RESULT_DATA_KEY       = "data";
    public static final String RESULT_TOTAL_PAGE_KEY = "total_page";
    public static final String RESULT_TOTAL          = "total";

    public static final String LIST                  = "LIST";

    public static final String DW_LIST               = "DW_LIST";

    public static final String READY_CHECK           = "READY_CHECK";

    public static final String READY_LIST            = "READY_LIST";

    public static final int    DEFAULT_PAGE_SIZE     = 10;

    public static final String LOGIN_MSG_URL_KEY     = "login_msg_url";

    /*
     * 站内信类型 1=用户信 2=系统信
     */
    public static class mType {

        public static final int USER = 1;
        public static final int SYS  = 2;
    }

    public static class sType {

        public static final String APP   = "app";
        public static final String MUSIC = "music";
        public static final String VIDEO = "video";
    }

    /*
     * 站内信阅读状态，0为未读，1为已读
     */
    public static class readStatus {

        public static final int UNREAD = 0;
        public static final int READED = 1;
    }

}
